extension Equals on String {
  bool equals(Object anObject) {
    if (identical(this, anObject)) {
      return true;
    }
    if (anObject is String) {
      String anotherString = anObject;
      int n = codeUnits.length;
      if (n == anotherString.codeUnits.length) {
        List<int> v1 = codeUnits;
        List<int> v2 = anotherString.codeUnits;
        int i = 0;
        while (n-- != 0) {
          if (v1[i] != v2[i]) {
            return false;
          }
          i++;
        }
        return true;
      }
    }
    return false;
  }
}

extension BoolValue on String {
  bool isTrue() {
    return toLowerCase().equals("true");
  }
}

extension IntValue on String {
  int? toInt() {
    return int.tryParse(this);
  }
}
